﻿const express=require('express');
const bodyParser=require('body-parser');
const userRouter=require('./routers/user.js');       //用户路由
const productRouter=require('./routers/product.js'); //商品路由
const indexRouter=require('./routers/index.js');     //首页路由
const shoppingCart=require('./routers/shoppingCart');//购物车路由
const app=express();
app.listen(8080);
app.use(express.static('./public'));
app.use(bodyParser.urlencoded({
    extended:false
}));

//挂载路由器（放在最后）
//用户路由
app.use('/user',userRouter);
//商品路由
app.use('/product',productRouter);
//网站主页路由
app.use('/index',indexRouter);

app.use('/shopping',shoppingCart);
